package com.glink.common.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

/**
 * Created by Administrator on 2024/03/13.
 *
 * @author zk
 */
@Data
@NoArgsConstructor
public class PageVO {
    
    private Integer page = 1;

    @Max(10000)
    @Min(1)
    @ApiModelProperty(notes = "每页条数", example = "10")
    private Integer size = 10;

    public PageVO(Integer page, Integer size) {
        this.page = page;
        this.size = size;
    }

    public Integer getOffset() {
        return size * page;
    }
}
